<?php
class front_home_headerSticker extends Nine_Sticker
{
	public function run()
	{
		$menus = array(
			0 => array(
				'url' => Nine_Registry::getBaseUrl(),
				'name' => Nine_Language::translate('Home'),
				'id' => 'home',
				'childs' => array()
				),
			1 => array(
				'url' => Nine_Route::_('content/index/detail/id/1'),
				'name' => Nine_Language::translate('VNG Fresher'),
				'id' => 'fresher',
				'childs' => array(
							0 => array(
								'url' => Nine_Route::_('content/index/detail/id/1'),
								'name' => Nine_Language::translate('Introduction'),
								'id' => 'fresher_introduction',
								'childs' => array()
							),
							1 => array(
								'url' => Nine_Route::_('recruitment/index/index'),
								'name' => Nine_Language::translate('Recruiment Program'),
								'id' => 'recruiment',
								'childs' => array()
							),
							2 => array(
								'url' => Nine_Route::_('register/index/index'),
								'name' => Nine_Language::translate('Register'),
								'id' => 'register',
								'childs' => array()
							),
							3 => array(
								'url' => Nine_Route::_('content/index/detail/id/19'),
								'name' => Nine_Language::translate('Recruitment Process'),
								'id' => 'fresher_recruitment',
								'childs' => array()
							),
							4 => array(
								'url' => Nine_Route::_('content/index/detail/id/21'),
								'name' => Nine_Language::translate('Training Program'),
								'id' => 'fresher_training',
								'childs' => array()
							),
							5 => array(
								'url' => Nine_Route::_('content/index/detail/id/17'),
								'name' => Nine_Language::translate('Typical Face'),
								'id' => 'fresher_typical_face',
								'childs' => array()
							)
						)
				),
			2 => array(
				'url' => Nine_Route::_('content/index/detail/id/5'),
				'name' => Nine_Language::translate('Internship'),
				'id' => 'internship',
				'childs' => array(
							0 => array(
								'url' => Nine_Route::_('content/index/detail/id/5'),
								'name' => Nine_Language::translate('Introduction'),
								'id' => 'internship_introduction',
								'childs' => array()
							),
							1 => array(
								'url' => Nine_Route::_('internship/index/index'),
								'name' => Nine_Language::translate('Register Internship'),
								'id' => 'internship_register',
								'childs' => array()
							)
						)
				),
			3 => array(
				'url' => Nine_Route::_('content/index/detail/id/7'),
				'name' => Nine_Language::translate('VNG Tour'),
				'id' => 'vng_tour',
				'childs' => array(
							0 => array(
								'url' => Nine_Route::_('content/index/detail/id/7'),
								'name' => Nine_Language::translate('Introduction'),
								'id' => 'vng_tour_introduction',
								'childs' => array()
							),
//							1 => array(
//								'url' => Nine_Route::_('gallery/index/vng-tour'),
//								'name' => Nine_Language::translate('Gallery'),
//								'id' => 'vng_tour_gallery',
//								'childs' => array()
//							),
							1 => array(
								'url' => Nine_Route::_('register/index/vng-tour'),
								'name' => Nine_Language::translate('Register'),
								'id' => 'vng_tour_register',
								'childs' => array()
							)
						)
				),
			4 => array(
				'url' => Nine_Route::_('gallery/index/index'),
				'name' => Nine_Language::translate('Gallery'),
				'id' => 'gallery',
				'childs' => array()
				),	
			5 => array(
				'url' => Nine_Route::_('contact/index/index'),
				'name' => Nine_Language::translate('Contact'),
				'id' => 'contact',
				'childs' => array()
				),	
			);
		/**
		 * Assign to view
		 */
		$this->view->menus = $menus;
		$currentLink = @rtrim(Nine_Registry::getConfig('liveSite'),'/').'/'. substr($_SERVER['REQUEST_URI'], strlen(Nine_Registry::getBaseUrl()));
		$this->view->currentLink = urlencode($currentLink);
		
		/**
		 * Title
		 */
		@preg_match('/\<title\>(.*)\<\/title\>/', $this->view->headTitle->toString(), $matches);
		$this->view->currentTitle = urlencode(@$matches[1]);
		
		
	}
}